package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author AthenaKnovesp
 */
@Mapper
public interface StudentMapper extends BaseMapper<Student> {

    // 可添加自定义的接口方法

    // 注解方式
//    @Select("select * from user")
//    public List<User> findAll();

    //
    @Select("SELECT a.*,b.* FROM student a,leavestu b  WHERE a.username=b.username and a.name LIKE CONCAT('%',#{search},'%')")
    List<Student> findsql(String search, int offset, int limit);


    @Select("SELECT a.* FROM student a  WHERE a.name LIKE CONCAT('%',#{search},'%') ")
    List<Student> findAll(String search, int offset, int limit);


}
